

from concurrent.futures import process
from model.postprocess.ANMS import ProcessANMS
from model.postprocess.TOPM import ProcessTOPM
from model.postprocess.MaskANMS import ProcessMaskANMS

# def process_featureset(process_cmd,args, feature_set,context = None):
#     if "ANMS" in process_cmd:
#         if "MaskANMS" in process_cmd:
#             anms = ProcessMaskANMS(args,context)
#             feature_set = anms.run(feature_set)
#         else:
#             anms = ProcessANMS(args)
#             feature_set = anms.run(feature_set)
    
#     if "TOPM" in process_cmd:
#         topm = ProcessTOPM(args)
#         feature_set = topm.run(feature_set)
    
#     return feature_set

def process_featureset(process_cmd, input_featureset,output_featureset,context = None):
    if "ANMS" in process_cmd:
        if "MaskANMS" in process_cmd:
            anms = ProcessMaskANMS(context)
            
        else:
            anms = ProcessANMS(context)
    
    if "TOPM" in process_cmd:
        topm = ProcessTOPM(context)
        
    anms.run(input_featureset,output_featureset)
    return 0

    

def process_image(process_cmd,args, img_features,context = None):
    if "ANMS" in process_cmd:
        if "MaskANMS" in process_cmd:
            anms = ProcessMaskANMS(args,context)
            img_features = anms.run_img(img_features)
        else:
            anms = ProcessANMS(args)
            img_features = anms.run_img(img_features)

    if "ANMS" in process_cmd:
        
        anms = ProcessANMS(args)
        img_features = anms.run_img(img_features)
    
    if "TOPM" in process_cmd:
        topm = ProcessTOPM(args)
        img_features = topm.run_img(img_features)
    
    return img_features